package org.sea.mybator.model;

public enum ColumnEnum {
    TABLE_CAT(1, "TABLE_CAT"), TABLE_SCHEM(2, "TABLE_SCHEM"), TABLE_NAME(3, "TABLE_NAME"), COLUMN_NAME(4, "COLUMN_NAME"), DATA_TYPE(
            5, "DATA_TYPE"), TYPE_NAME(6, "TYPE_NAME"), COLUMN_SIZE(7, "COLUMN_SIZE"), BUFFER_LENGTH(8, "BUFFER_LENGTH"), DECIMAL_DIGITS(
            9, "DECIMAL_DIGITS"), NUM_PREC_RADIX(10, "NUM_PREC_RADIX"), NULLABLE(11, "NULLABLE"), REMARKS(12, "REMARKS"), COLUMN_DEF(
            13, "COLUMN_DEF"), SQL_DATA_TYPE(14, "SQL_DATA_TYPE"), SQL_DATETIME_SUB(15, "SQL_DATETIME_SUB"), CHAR_OCTET_LENGTH(
            16, "CHAR_OCTET_LENGTH"), ORDINAL_POSITION(17, "ORDINAL_POSITION"), IS_NULLABLE(18, "IS_NULLABLE");

    private int code;
    private String desc;

    private ColumnEnum() {
    }

    private ColumnEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ColumnEnum valueOfEnum(int code) {
        switch (code) {
            case 1:
                return TABLE_CAT;
            case 2:
                return TABLE_SCHEM;
            case 3:
                return TABLE_NAME;
            case 4:
                return COLUMN_NAME;
            case 5:
                return DATA_TYPE;
            case 6:
                return TYPE_NAME;
            case 7:
                return COLUMN_SIZE;
            case 8:
                return BUFFER_LENGTH;
            case 9:
                return DECIMAL_DIGITS;
            case 10:
                return NUM_PREC_RADIX;
            case 11:
                return NULLABLE;
            case 12:
                return REMARKS;
            case 13:
                return COLUMN_DEF;
            case 14:
                return SQL_DATA_TYPE;
            case 15:
                return SQL_DATETIME_SUB;
            case 16:
                return CHAR_OCTET_LENGTH;
            case 17:
                return ORDINAL_POSITION;
            case 18:
                return IS_NULLABLE;
        }
        return null;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
